//
//  BNRReminderViewController.m
//  Quiz
//
//  Created by YaoJacob on 15/11/2.
//  Copyright © 2015年 Roger. All rights reserved.
//

#import "BNRReminderViewController.h"

@interface BNRReminderViewController ()
@property (nonatomic, weak) IBOutlet UIDatePicker *datePicker;
@end

@implementation BNRReminderViewController

-(instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        self.tabBarItem.title = @"提醒";
        self.tabBarItem.image = [UIImage imageNamed:@"Time"];
    }
    return self;
}

-(IBAction)addReminder:(id)sender
{
    NSDate *date = self.datePicker.date;
    NSLog(@"set reminder date: %@", date);  //时区问题
    
    UILocalNotification *note = [[UILocalNotification alloc]init];
    note.alertBody = @"⏰我,ok.";
    note.fireDate = date;
    
    //???
    //    [[UIApplication sharedApplication] scheduledLocalNotifications:note];
}

-(void)viewDidLoad
{
    [super viewDidLoad];
    NSLog(@"%@ : %@", self, @"viewDidLoad");
}

-(void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    NSLog(@"%@ : %@", self, @"viewDidAppear");
}

-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    NSLog(@"%@ : %@", self, @"viewWillAppear");
    
}
@end
